package com.ccx.demo.service.Impl;

import com.ccx.demo.dao.SysUserDao;
import com.ccx.demo.pojo.SysRole;
import com.ccx.demo.pojo.SysUser;
import com.ccx.demo.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class SysUserServiceImpl implements SysUserService {
    @Resource
    private SysUserDao sysUserDao;
    @Override
    public SysUser SelectUsernameByName(String username) {
        return sysUserDao.SelectUsernameByName(username);
    }

    @Override
    public String SelectPassword(String username) {
        return sysUserDao.SelectPassword(username);
    }

    @Override
    public SysRole SelectRole(int userId) {
        return sysUserDao.SelectRole(userId);
    }

    @Override
    public List<String> selectIdAuthority(int id) {
        return sysUserDao.selectIdAuthority(id);
    }

    @Override
    public boolean addUser(SysUser user) {
        return sysUserDao.addUser(user);
    }

    @Override
    public boolean addUserRole(Integer user_id, Integer role_id) {
        return sysUserDao.addUserRole(user_id,role_id);
    }

    @Override
    public List<SysUser> QueryAll() {
        return sysUserDao.QueryAll();
    }

    @Override
    public List<SysRole> QueryByRole() {
        return sysUserDao.QueryByRole();
    }

    @Override
    public boolean DelById(Integer id) {
        return sysUserDao.DelById(id);
    }
}
